package com.falcon.domain.req;

import com.falcon.domain.po.QuestionOptionPO.Fields;
import com.falcon.mvc.domain.AbsPageQuery;
import com.swan.mybatis.condition.Condition;
import com.swan.mybatis.condition.OpType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;


/** 选项
* @author zongf
* @since 2024-03-03
*/
@Data
@Accessors(chain = true)
public class QuestionOptionQuery extends AbsPageQuery{

    /** 主键 */
    private Long id;

    /** 创建者 */
    private String creator;

    /** 创建时间 */
    private Date createTime;

    /** 标题id */
    private Long questionId;

    /** 选项内容 */
    private String label;

    /** 值 A,B,C,D... */
    private String value;

    /** 是否是正确选项 */
    private Integer correct;

    @Override
    public Condition toCondition() {
        Condition condition = Condition.newInstance();
        condition.and(Fields.questionId, OpType.equals, this.questionId);

        return condition;
    }

}

